

<template>
  <div ::key="index" v-for="(item,index) in data">
  {{item}}
  <!--递归组件自己调用自己-->
  <HelloWorldTtem v-if='item?.children?.length' :data="item.children"></HelloWorldTtem>
  </div>
</template>
<script setup lang="ts">
import { ref,reactive} from 'vue'
import HelloWorldTtem from './HelloWorld.vue'
type TreeList = {
  name: string;
  icon?: string;
  children?: TreeList[] | [];
};
type Props<T> ={
  data? : T[] | []
}
defineProps<Props<TreeList>>()
</script>

